package com.deepconv.abbebot.xread.network;

import java.io.IOException;


public class HttpApiHelper {
    private final String TAG = HttpApiHelper.class.getSimpleName();

    private static HttpApiHelper instance = null;


    public synchronized static HttpApiHelper getInstance() {
        if (instance == null) {
            instance = new HttpApiHelper();
        }
        return instance;
    }

    private HttpApiHelper() {

    }

    public String doBookCoverSearchPOST(byte[] bodyStr, Object tag) {
        String resBody = null;
        com.squareup.okhttp.Response response = OkHttpClientManager.postSyncOctetStream(HttpApiEndPoint.BOOK_SEARCH_URL, bodyStr, tag);
        if (response != null) {
            try {
                resBody = response.body().string();
            } catch (IOException e) {
                resBody = "0";
            }
        } else {
            resBody = "0";
        }
        return resBody;
    }
}

